#include <bits/stdc++.h>
using namespace std;

int n;

int main()
{
    cin >> n;
    if (n % 2 == 0)
    {
        cout << "NOT POSSIBLE" << endl;
        return 0;
    }
    string s;
    cin >> s;
    int l = (n - 1) / 2;
    string s1 = s.substr(0, l), s2 = s.substr(l + 1, l);
    int cnt1 = 0, cnt2 = 0;
    for (int i = l; i < n && cnt1 < l; i++)
        if (s[i] == s1[cnt1])
            cnt1++;
    
    for (int i = 0; i < l + 1 && cnt2 < l; i++)
        if (s[i] == s2[cnt2])
            cnt2++;

    if (cnt1 != l && cnt2 != l)
        cout << "NOT POSSIBLE" << endl;
    else if (cnt1 == l && cnt2 == l && s1 != s2)
        cout << "NOT UNIQUE" << endl;
    else
    {
        if (cnt1 == l)
            cout << s1;
        else
            cout << s2;
        cout << endl;
    }
    return 0;
}